<?php
$xmlDoc = new DOMDocument();
$xmlDoc->load("a.xml");

$x = $xmlDoc->documentElement;
foreach($x->childNodes[1]->attributes as $b) {
	echo $b->nodeName . ":" . $b->nodeValue . "\n";	
}
foreach ($x->childNodes AS $item) {
	//print $item->nodeName . " = " . $item->nodeValue . "\n";
		if(isset($x->item->nodeName) && '#text' == $x->item->nodeName) {
			return;
		}
	var_dump($item);print("\n");
}
?>